home *** CD-ROM | disk | FTP | other *** search
/ CD Exchange / CD Exchange - Volume 1.iso / d.t.p / utils / propage / donsgenies / donsgenies.lha / Don'sGenies / StepAndRepeatLinked.pprx < prev    next >
Text File  |  1992-07-16  |  3KB  |  101 lines

  1. /*
  2. StepAndRepeat Linked
  3. This Genie will make multiple copies of a box with user specified offset and rotation between copies. The boxes are linked in order of creation, allowing text to flow throgh the chain.
  4. (Modified from original Gold Disk genie by Don Cox.)
  5. */
  6. cr = '0a'x
  7. address command
  8. call SafeEndEdit.rexx()
  9. units = ppm_GetUnits()
  10. if units = 3 then
  11.     call ppm_SetUnits(1)
  12.  
  13. signal on halt
  14. signal on break_c
  15. signal on break_e
  16. signal on break_d
  17. form    = "Columns"cr"Rows"cr"Gutter"
  18.  
  19. /* This Genie allows user to duplicate, move and rotate a box
  20.  * in one step
  21.  */
  22.  
  23. box = ppm_ClickOnBox("Click on box to duplicate..")
  24. if box = 0 then exit_msg()
  25. dup = 0
  26.  
  27. boxpos  = ppm_GetBoxPosition(box)
  28. cur_x   = word(boxpos, 1 )
  29. cur_y   = word(boxpos, 2 )
  30.  
  31. boxsize = ppm_GetBoxSize(box)
  32. width   = word(boxsize, 1 )
  33. height  = word(boxsize, 2 )
  34.  
  35. if units = 3 then
  36. do
  37.    call ppm_ShowStatus("Position: " || ppm_ConvertUnits(1, 3, cur_x) || ", " || ppm_ConvertUnits(1, 3, cur_y) || " size: w" || ppm_ConvertUnits(1, 3, width) || ", h" || ppm_ConvertUnits(1, 3, height))
  38.  
  39.    form = "count:1"cr"horizontal offset:" || ppm_ConvertUnits(1, 3, width)||cr"vertical offset:" || ppm_ConvertUnits(1, 3, height)||cr"angle"
  40.  
  41. end
  42. else
  43. do
  44.    call ppm_ShowStatus("Position: "cur_x", "cur_y" size: w"width", h"height)
  45.    form ="count:1"cr"horizontal offset:"width||cr"vertical offset:"height||cr"angle"
  46. end
  47.  
  48. form = ppm_GetForm("Step & Repeat", 8, form)
  49. if form = '' then exit_msg()
  50. parse var form count '0a'x  horizontal '0a'x vertical '0a'x angle
  51.  
  52. if count = '' then count = 1
  53. if horizontal = '' then horizontal = 0
  54. if vertical = '' then vertical = 0
  55. if angle = '' then angle = 0
  56.  
  57. if ~(datatype(count, n) & datatype(horizontal, n) & datatype(vertical, n) & datatype(angle, n)) then exit_msg("Invalid Entry")
  58.  
  59. if units = 3 then
  60. do
  61.    horizontal = ppm_ConvertUnits(3, 1, horizontal)
  62.    vertical = ppm_ConvertUnits(3, 1, vertical)
  63. end
  64.  
  65. call ppm_AutoUpdate(0)
  66. rotationangle = angle
  67.  
  68. do i = 1 to count
  69.  
  70.     newbox = ppm_CloneBox(box, horizontal, vertical)
  71.  
  72.     linked = ppm_LinkBox(box,newbox)
  73.  
  74.     if angle ~= 0 then
  75.     do
  76.         call ppm_SetBoxAngle(newbox, rotationangle)
  77.         rotationangle = rotationangle + angle
  78.     end
  79.  
  80.     box = newbox
  81.  
  82. end
  83.  
  84. exit_msg()
  85. break_d:
  86. break_e:
  87. break_c:
  88. halt:
  89.     call exit_msg("User aborted Genie!")
  90.  
  91. exit_msg: procedure  expose units
  92. do
  93.     parse arg message
  94.  
  95.     if message ~= '' then call ppm_Inform(1, message,)
  96.     call ppm_ClearStatus()
  97.    if units = 3 then call ppm_SetUnits(3)
  98.     call ppm_AutoUpdate(1)
  99.     exit
  100. end
  101.